Repository navigation
Conversation
…string-utils, task-manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes all 60 tests pass (previously 44 pass / 16 fail).
tsc --noEmitis clean. No test files were changed and no dependencies were added.dividethrowsError("Division by zero")whenb === 0.formatRelativerounds days withMath.round(Math.abs(hours)/24), so 36h gives "2 days ago". Past and future dates now round the same way.isEmailaccepts TLDs of 2 or more characters (it used to cap them at 4).isUrlno longer rejects URLs with a port.wordCountsplits on runs of whitespace.truncateis implemented: it cuts at a word boundary and the ellipsis counts towardmaxLength.remove,updateandsortBy(priority,createdAt,status).Assumptions
sortBy('status')puts pending first, then in_progress, then completed. No test covers this order.truncatewithmaxLength <= 3returns the ellipsis cut down tomaxLength. A single word longer than the limit is cut mid-word.updateignores fields leftundefined, soupdatecan't clear a description.Known limitations (not changed, out of scope)
isUrlonly checks the protocol, so URLs containing credentials still pass. Don't use it as a security control.isEmailaccepts some malformed addresses (e.g.a@b..com).